import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/index/index";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Index",
    component: Home,
    children: [
      {
        path: "/user",
        name: "User",
        component: () => import("../views/user/index")
      }
    ]
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;


 /* function Vehicle() {
   this.engines = 1
 }

 Vehicle.prototype.ignition = function() {
   console.log("Turing on my enginee")
 }

 Vehicle.prototype.drive = function() {
   this.ignition();
   console.log("Steering and moving forward!")
 }

 function Car() {
   var car = new Vehicle();
   car.wheels = 4

   var vehDrive = car.drive

   car.drive = function() {
     vehDrive.call(this)
     console.log("Rolling on call " + this.wheels + " wheels!!")
   }
   return car
 }

 var myCar = Car();
 myCar.drive() */